package day10;

public interface Cpu {
    void work();

    void stop();
}

class Cpu1 implements Cpu {
    private String brand;
    private String zhuping;

    public Cpu1(String brand, String zhuping) {
        this.brand = brand;
        this.zhuping = zhuping;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getZhuping() {
        return zhuping;
    }

    public void setZhuping(String zhuping) {
        this.zhuping = zhuping;
    }

    @Override
    public void work() {
        System.out.println(brand + "牌CPU,开始工作了，它的主频是" + zhuping);
    }

    @Override
    public void stop() {
        System.out.println("电脑关机了，CPU停止工作");
    }
}

interface EMS {
    void interposition();

    void pullout();
}

class EMS1 implements EMS {
    private String capacity;

    public EMS1(String capacity) {
        this.capacity = capacity;
    }

    public String getCapacity() {
        return capacity;
    }

    public void setCapacity(String capacity) {
        this.capacity = capacity;
    }

    @Override
    public void interposition() {
        System.out.println("插入内存条，内存条的容量是"+capacity);

    }

    @Override
    public void pullout() {
        System.out.println("拔出内存条");

    }
}
interface HardDisk{
    void cutin();
    void bachu();
}
class HardDisk1 implements HardDisk{
private String rongliang;

    public HardDisk1(String rongliang) {
        this.rongliang = rongliang;
    }

    public String getRongliang() {
        return rongliang;
    }

    public void setRongliang(String rongliang) {
        this.rongliang = rongliang;
    }

    @Override
    public void cutin() {
        System.out.println("硬盘接入电脑，这个硬盘容量是"+rongliang);
    }

    @Override
    public void bachu() {
        System.out.println("硬盘拔出电脑");
    }
}
class Test4{
    public static void main(String[] args) {
        Cpu cpu=new Cpu1("爱国者","3.8GHZ");
        EMS ems=new EMS1("3000GB");
        HardDisk hardDisk=new HardDisk1("4GB");
        cpu.work();cpu.stop();
        ems.interposition();ems.pullout();
        hardDisk.cutin();hardDisk.bachu();
    }
}